<template>
  <div class="about">
    <h1>This is an about page</h1>
    <pre>{{ list }}</pre>
    <input type="text" v-model="result">
    <button @click="add">添加</button>
  </div>
</template>



<script lang='ts' setup>
import { useRoute } from 'vue-router'
import { useStore } from 'vuex'
import { computed, ref } from 'vue'

const store = useStore()
const route = useRoute();

const result = ref('')
// 动态路由参数
console.log(route.params);
// 查询字符串参数
console.log(route.query);

const list = computed(() => store.state.list)
const add = () => {
  store.commit('addListItem', result.value)
}
</script>